﻿using System;
using System.Collections.Generic;
using System.Text;
using Discuz.Toolkit;
using System.Web;

namespace Icst.Leaflike.Discuz
{
    public static class ConformityHandler
    {
        public static string apikey, secret, webserver;
        private static bool IsInitObject = false;
        public static DiscuzSession ds;
        static ConformityHandler()
        {
            if (!IsInitObject)
            {
                apikey = AppConfig.DNTAPIKey;
                secret = AppConfig.DNTSecert;
                webserver = AppConfig.DNTWebServer;
                ds = new DiscuzSession(apikey, secret, webserver);
                IsInitObject = true;
            }
        }
        public static DiscuzSession InitDiscuzSession()
        {
            return ds;
        }
        /// <summary>
        /// 根据SNS登录E-mail创建论坛登录ID
        /// </summary>
        /// <param name="Email"></param>
        /// <returns></returns>
        public static string CreateDiscuzNTUsername(string Email)
        {
            //return Email.Remove(Email.IndexOf("@"));
            return Email;
        }
    }
}
